package com.zx.designpattern.model.bean;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.zx.designpattern.utils.StringUtils;

import java.io.Serializable;

@JsonIgnoreProperties(ignoreUnknown = true)//可忽略多余字段
public class User implements Serializable {
    private Integer id = -1;

    private String penName;

    private String tel;

    private String email;

    private String url;

    private String pwd;

    private Integer money;

    private Integer sex;

    private Integer status;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getPenName() {
        String tel = StringUtils.hideTel(this.tel);
        return StringUtils.isEmpty(penName) ? StringUtils.getNotNullStr(tel) : penName;
    }

    public void setPenName(String penName) {
        this.penName = penName == null ? null : penName.trim();
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel == null ? null : tel.trim();
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url == null ? null : url.trim();
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd == null ? null : pwd.trim();
    }

    public Integer getMoney() {
        return money;
    }

    public void setMoney(Integer money) {
        this.money = money;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
}